<script type="text/javascript"> 
 
    $(document).ready(function(){ 
		// initialise Superfish 
        $("ul.sf-menu").superfish({ 
            pathClass:  'Photos' 
        }); 
    }); 

</script>

	<h2><?php echo $pageTitle; ?></h2>

	<table cellpadding="2" cellspacing="3" class="list">
		<thead>
			<td class = "listID"><a href="<?=APP_ROOT;?>/photos/index/orderBy:id<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'id') echo '/DESC:true';?>">ID</a></td>
			<td>Preview</td>
			<td><a href="<?=APP_ROOT;?>/photos/index/orderBy:name<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'name') echo '/DESC:true';?>">Name</a></td>
			<td><a href="<?=APP_ROOT;?>/photos/index/orderBy:filename<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'filename') echo '/DESC:true';?>">filename</a></td>
			<td><a href="<?=APP_ROOT;?>/photos/index/orderBy:group<?php if(isset($orderBy) && !isset($DESC) && $orderBy == 'group') echo '/DESC:true';?>">Group</a></td>
			
			<td  align="center">Action</td>
		</thead>
		<? 
			$i = 0;
			foreach ($photos as $photo){
				$i++;
				$id = $photo['Photo']['id'];
				$name = $photo['Photo']['name'];
				$filename = $photo['Photo']['filename'];				
				$group = $photo['Photo']['group'];				
		?>
		<tr class="<?php if($i%2) echo 'zuyg'; else echo 'kent';  ?>">
			<td class = "listID">
				<? echo $id; ?>
			</td>
			<td><img width="40" src="<?=APP_ROOT?>/img/Photos/small/<? echo $filename; ?>" onmouseover="this.width =this.naturalWidth; this.className='positionAbs'" onclick="this.width +=100; this.className='positionAbs'"  onmouseout="this.width=40;  this.className=''" style="cursor:pointer;" />	
			</td>
			<td>
				<? echo $name; ?></td>
			<td>
				<? echo $filename; ?></td>
			<td>
				<? echo $group; ?></td>
			
			
			<td class = "listAction" style="width: 40px;">
				<a title="delete" onclick="javascript:del(<?php echo $id; ?>)" href="#" ><img src="<?=APP_ROOT;?>/img/icons/Colored/GIF/action_delete.gif" /></a>
			</td>
		</tr>
		<?
		}//for main products
		?>
	</table>
<script language="javascript" type="text/javascript">
function del(id){
	if (confirm("Are you sure?")) {
    	window.location.href = "<?=APP_ROOT;?>/photos/delete/"+id;
	}
}
</script>